<?php print $controller->render('views/includes/header.php');?>

<div class='article'>
<h2 id="api"><a name="api"></a>API</h2>
<p>You are likely to need to <a href="http://php.net/urlencode">url_encode</a> the url before you send it, especially if it contains ampersands (&amp;). Again, test to make sure.</p>
<p>If you are likely to be doing more than 10 API calls a day, please contact <a href='mailto:api@urltea.com?subject=urlTea - help with the API'>api@urltea.com</a> and we'll help you out.</p>

<hr />

<h3>Plain Text</h3>
<p>Supports both GET and POST methods</p>
<p><code><a href="http://urltea.com/api/text/?url=www.example.com">http://urltea.com/api/text/?url=<em>www.example.com</em></a></code></p>
<p>returns</p>
<p><code>http://urltea.com/11</code></p>

<hr />

<h3><a href="http://json.org/"><acronym title='JavaScript Object Notation'>JSON</acronym></a></h3>
<p>Supports both GET and POST methods</p>
<p><code><a href="http://urltea.com/api/json/?url=www.example.com">http://urltea.com/api/json/?url=<em>www.example.com</em></a></code></p>
<p>returns</p>
<p><code>urltea = {url:'http://urltea.com/11', keycode: '11', error: '', message: 'Hey, someone already made this one for you!'};</code></p>

<hr />

<h3>Notes</h3>
<p><code>http://urltea.com/api/text/<strong>create.php</strong>?url=www.example.com</code> etc. still works, but is deprecated.</p>

</div><!-- close .article -->

<?php print $controller->render('views/includes/footer.php');?>